home *** CD-ROM | disk | FTP | other *** search
- Path: zipper.zip.com.au!not-for-mail
- From: craig@zip.com.au (Craig Pardey)
- Newsgroups: comp.lang.rexx
- Subject: Re: How do I read from a file?
- Date: 17 Apr 1996 10:22:58 +1000
- Organization: Zip Australia Pty Ltd
- Distribution: inet
- Message-ID: <4l1dl2$7ta@zipper.zip.com.au>
- References: <4ktd9n$3qe@zipper.zip.com.au> <4kus4q$dvh@sam.inforamp.net>
- NNTP-Posting-Host: zipper.zip.com.au
- X-Newsreader: NN version 6.5.0 #5 (NOV)
-
- >>I just need to know how to open, read from and close a file in rexx. I have looked in the faq
- >>and it's ot there. Is there an easy way to pull a certain line from the file, or even certain
- >>elements like there is in awk?
-
- >Have you tried to use Rexx built-in functions like LineIn() LineOut()
- >CharIn() and CharOut(); whcih are used to perform file I/O.
-
- >To read/write to a file:
-
-
- >MyFile = "C:\CONFIG.SYS"
- >NewFile = "C:\CONFIG.BKP"
-
- >Do While Lines(MyFile) /* Continue reading until the end-of-file */
- > InLine = LineIn(Myfile) /* Reads from a file variable myfile */
- > Say InLine /* Display line read on the screen */
- > OutLine = LineOut(NewFile) /* Writes to a file variable NeWfile */
- >End
-
- Thanx a lot. I got it all working now :)
-
- cheers,
- craig
-
- --
- | /===\/===\ | "Better get a lawyer, Son" |
- | | OO |=============888 | "Better get a real good one." |
- | \===/\===/ | - Cruel Sea |
-
-